Login
Authentication
Login
Authenticate a user and receive a JWT access token
POST
Login
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LizandroCanul/back_sdo/llms.txt
Use this file to discover all available pages before exploring further.
Description
Authenticates a user with their email and password. On successful authentication, returns a JWT access token and user information. The token should be included in the Authorization header for subsequent API requests.Request Body
User’s email address
User’s password
Response
JWT access token for authentication. Include this token in the Authorization header as
Bearer {token} for subsequent requests.User information object
Response Examples
Code Examples
Authentication Flow
- Send a POST request to
/auth/loginwith valid email and password - Receive the JWT
access_tokenin the response - Store the token securely (e.g., in localStorage, sessionStorage, or secure cookie)
- Include the token in the
Authorizationheader for all subsequent API requests: - The token contains the user’s ID, email, and roles encoded in the JWT payload
Error Handling
| Status Code | Description |
|---|---|
| 200 | Authentication successful |
| 401 | Invalid credentials (wrong email or password) |
| 400 | Bad request (missing email or password) |
Security Notes
- Passwords are hashed using bcrypt before storage
- The JWT token includes user ID (
sub), email, and roles in the payload - Tokens should be transmitted only over HTTPS in production
- Store tokens securely and never expose them in URLs or logs